<?php

namespace Common\Context;

class ConnectionManager
{
    private static array $connectionMap = [];

    public static function add($clientId, $connection): void
    {
        self::$connectionMap[$clientId] = $connection;
    }

    public static function remove($clientId): void
    {
        unset(self::$connectionMap[$clientId]);
    }

    public static function getConnection($clientId)
    {
        return self::$connectionMap[$clientId] ?? null;
    }
}
